package com.njsf.controller.front;

import com.njsf.dto.ResponseJson;
import com.njsf.pojo.Book;
import com.njsf.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@Controller
@RequestMapping("/front")
public class BookFrontController {

    @Autowired
    private BookService bookService;

    @RequestMapping("/bookdetail")
    public String bookDetail(Integer id, Map<String,Object> map){
        Book book = bookService.bookDetail(id);
        map.put("book",book);
        return "front/bookinfo";
    }

}
